<?php
if($this->do=='more'){
	check_request();
	$category_id=empty($_GET['category_id'])?0:intval($_GET['category_id']);
	$sql="SELECT * FROM ".DB_PREFIX."content_article WHERE article_is_display=1";
	if($category_id>0){
		$sql.=" AND category_id=$category_id";
	}
	$sql.="  ORDER BY article_id DESC";
	$page_size=$this->config['content_front_index_size'];
	$page_current=isset($_GET['page'])&&is_numeric($_GET['page'])?intval($_GET['page']):2;
	$count=$this->db->count($sql);
	$page_count=ceil($count/$page_size);
	if($page_current>$page_count){
		exit('OVER');
	}
	$result=$this->db->result($sql." LIMIT ".(($page_current-1)*$page_size).",".$page_size);
	$array=array();
	if($count>0){
		foreach($result as $row){
			$array[$row['article_id']]['id']=$row['article_id'];
			$array[$row['article_id']]['title']=$row['article_title'];
			$array[$row['article_id']]['content']=$content->get_short_content($row['article_content']);
			$array[$row['article_id']]['author']=$row['article_author'];
			$array[$row['article_id']]['image']=$row['article_image'];
			$array[$row['article_id']]['uri']=PATH.HTML_DIR.$content->category_parent_path($row['category_id'])."/".$row['article_html'].".html";
			$array[$row['article_id']]['time']=date("Y.m.d",$row['article_time']);
			$array[$row['article_id']]['comment_count']=$row['article_comment_count'];
			$array[$row['article_id']]['click_count']=$row['article_click_count'];
			$array[$row['article_id']]['category_id']=$row['category_id'];
		}
	}
	$this->template->in('article_list',$array);
	$this->template->out('content.more.php');
}
?>